<template>
	<view :class="[$themeClass('page-bg-color')]">
		<!-- 头部 -->
		<view class="ex-mall-header" :class="[$themeClass('header-bg-color')]">
			<!-- #ifdef MP-WEIXIN -->
			<view class="ex-mall-header-mp-weixin-fill" :class="[$themeClass('header-title-color')]">收藏</view>
			<!-- #endif -->
			<view class="ex-mall-header-content">
				<view class="ex-mall-header-left">
					<view class="ex-mall-header-btn" @click="$util.navigateBack" :class="[$themeClass('header-btn-left-another-bg-color')]">
						<text class="ex-mall-header-btn-icon ri-arrow-left-s-line" :class="[$themeClass('header-btn-left-icon-another-color')]"></text>
					</view>
				</view>
				<view class="ex-mall-header-search">
					<input class="ex-mall-header-search-input" :class="[$themeClass('search-input-bg-color'), $themeClass('search-input-color')]"
					 type="text" placeholder="搜索商品..." :placeholder-class="$themeClass('search-input-placeholder')" />
					<view class="ex-mall-header-search-btn" @click="search" :class="[$themeClass('search-btn-bg-color'), $themeClass('search-btn-color')]">
						<view class="ex-mall-header-search-btn-icon ri-search-line"></view>
					</view>
				</view>
			</view>
		</view>

		<view class="ex-mall-panel favorite" :class="[$themeClass('panel-bg-color')]">
			<view class="ex-mall-panel-title" :class="[$themeClass('panel-title-bg-color'), $themeClass('panel-title-color')]">
				<view class="text">收藏</view>
			</view>
			<view class="ex-mall-panel-content" :class="[$themeClass('panel-content-bg-color')]">
				<view class="list">
					<view class="item" v-for="(x, xi) in favorites" :key="xi">
						<view class="left">
							<view class="thumbnail">
								<image class="img"></image>
							</view>
							<view class="info" :class="[$themeClass('panel-title-color')]">
								<view class="title">{{x.title}}</view>
								<view class="price">￥{{x.price.toFixed(2)}}</view>
							</view>
						</view>
						<view class="right">
							<view class="operate">
								<view class="btn del">
									<text class="icon ri-delete-bin-line"></text>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				favorites: [{
					thumbnail: '',
					title: '创意吊灯',
					price: 34.00
				}, {
					thumbnail: '',
					title: '电动牙刷',
					price: 73.00
				}, {
					thumbnail: '',
					title: '蓝牙音箱',
					price: 332.00
				}, {
					thumbnail: '',
					title: '创意桌子',
					price: 129.00
				}, {
					thumbnail: '',
					title: '创意吊灯',
					price: 34.00
				}, {
					thumbnail: '',
					title: '电动牙刷',
					price: 73.00
				}, {
					thumbnail: '',
					title: '蓝牙音箱',
					price: 332.00
				}, {
					thumbnail: '',
					title: '创意桌子',
					price: 129.00
				}]
			}
		},
		onLoad() {

		},
		methods: {
			search() {

			}
		}
	}
</script>

<style lang="scss">
	.ex-mall-header-search {
		margin-left: 28px;
	}

	.ex-mall-panel.favorite {
		.ex-mall-panel-content {
			min-height: calc(100vh - 78px - 80px);

			.list {
				padding: 0 28px 38px 28px;

				&>.item {
					display: flex;
					justify-content: space-between;
					align-items: center;
					width: 100%;
					margin-top: 38px;

					&:first-child {
						margin-top: 0;
					}

					&:nth-child(4n-3) {
						&>.left {
							&>.thumbnail {
								&>.img {
									background-color: #0EAA90;
								}
							}
						}
					}

					&:nth-child(4n-2) {
						&>.left {
							&>.thumbnail {
								&>.img {
									background-color: #F8E3DC;
								}
							}
						}
					}

					&:nth-child(4n-1) {
						&>.left {
							&>.thumbnail {
								&>.img {
									background-color: #A8A8A9;
								}
							}
						}
					}

					&:nth-child(4n) {
						&>.left {
							&>.thumbnail {
								&>.img {
									background-color: #7F8688;
								}
							}
						}
					}

					&>.left {
						display: flex;
						align-items: center;

						&>.thumbnail {
							&>.img {
								display: block;
								width: 88px;
								height: 88px;
								border-radius: 12px;
							}
						}

						&>.info {
							margin-left: 18px;
							line-height: 1;

							&>.title {
								line-height: 1.3;
								font-size: 15px;
								font-weight: 600;
							}

							&>.price {
								margin-top: 10px;
								font-size: 13px;
							}
						}
					}

					&>.right {
						&>.operate {
							&>.btn {
								display: flex;
								justify-content: center;
								align-items: center;
								width: 38px;
								height: 38px;
								border-radius: 12px;
								
								&.del {
									color: #FFFFFF;
									background-color: #404040;
								}
							}
						}
					}
				}
			}
		}
	}
</style>
